#include <bits/stdc++.h>
using namespace std;
void find_max_one_num(string& a,int start_inx,const int& count)
{
    if(start_inx<=a.length())
    {
        for(int i=start_inx;i<a.length();i++)
        {
            if(a[i] == '1'){
                find_max_one_num(a,start_inx+1,count+1);
            } else
            {
                start_inx++;
            }
        }
    }

}
int main() {
    string a = "11001111011001";
    int n = a.length();
    int count = 0;
    find_max_one_num(a,0,count);
    cout<<count<<endl;
    return 0;
}